/*
package com.gancp.common.security;


import com.gancp.cache.CommonCacheUtil;
import com.gancp.common.constants.Parmeters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;

*/
/**
 * @Author gancp
 * @Date 时间被黑洞吸走了
 * @Descripition 整合spring security   20180720先不要整合security 太麻烦了这个东西
 * <p>
 * 设置过滤器
 * <p>
 * <p>
 * 无需拦截的方法
 * " );
 * }
 * }
 *//*

*/
/*@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)*//*

public class SecurityConfig extends WebSecurityConfigurerAdapter {
    @Autowired
    private Parmeters parameters;

    @Autowired
    private CommonCacheUtil cacheUtil;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        int size = parameters.getNoneSecurityPath().size();
        String[] noneSec = parameters.getNoneSecurityPath().toArray( new String[size] );
        http.csrf().disable().authorizeRequests().antMatchers( noneSec ).permitAll().anyRequest().authenticated().
                and().sessionManagement().sessionCreationPolicy( SessionCreationPolicy.STATELESS ).and().httpBasic().authenticationEntryPoint( new RestAuthenticationEntryPoint() ).and().addFilter( getRestPreAuthenticatedProcessingFilter() );
    }

    */
/******
 * 设置过滤器
 * *****//*

    private RestPreAuthenticatedProcessingFilter getRestPreAuthenticatedProcessingFilter() throws Exception {
        RestPreAuthenticatedProcessingFilter filter = new RestPreAuthenticatedProcessingFilter( parameters.getNoneSecurityPath(), cacheUtil );
        filter.setAuthenticationManager( this.authenticationManagerBean() );
        return filter;

    }

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.authenticationProvider( new RestAuthenticationProvider() );
    }

    */
/*****
 *
 * 无需拦截的方法
 * ******//*

    @Override
    public void configure(WebSecurity web) throws Exception {
        // 忽略options方法的请求
        web.ignoring().antMatchers( HttpMethod.OPTIONS, "*/
/**" );
 }
 }
 */
